import request from '@/service/request'

import {
  IBrandResponse,
  IBrand,
  IBanner,
  IBannerResponse,
  INews,
  INewsResponse,
  IHot,
  IHotResponse,
  IProducts,
  IGoodsResponse,
  ISpecial,
  ISpecialResponse
} from './type/home.type'

export const findBrand = (limit: number) => {
  return request<IBrand, IBrandResponse>('/home/brand', 'get', { limit })
}

export const findBanner = () => {
  return request<IBanner, IBannerResponse>('/home/banner', 'get')
}

export const findNew = () => {
  return request<INews, INewsResponse>('home/new', 'get')
}

export const findHot = () => {
  return request<IHot, IHotResponse>('home/hot', 'get')
}

export const findGoods = () => {
  return request<IProducts, IGoodsResponse>('home/goods', 'get')
}

export const findSpecial = () => {
  return request<ISpecial, ISpecialResponse>('home/special', 'get')
}
